package com.example.lots_of_demo.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.lots_of_demo.model.Permission;
import com.example.lots_of_demo.po.PermissionGroupPo;
import com.example.lots_of_demo.po.PermissionGroupRoleIdPo;
import com.example.lots_of_demo.utils.R;
import com.example.lots_of_demo.vo.PermissionGroupVo;

import java.util.List;

/**
 * @author : LZJ
 * @description : code for LZJ
 * @date : 2021/2/16
 */
public interface PermissionService extends IService<Permission> {

    /**
     * 获取所有的权限组
     * @return List<PermissionGroupVo>
     */
    List<PermissionGroupVo> getPermissionGroup();

    /**
     * 根据角色ID获取已选择的权限组的ID
     * @param id 角色ID
     * @return List<Integer>
     */
    List<Integer> getCheckedPermissionGroupByRoleId(Long id);

    /**
     * 指定角色ID赋予权限资源
     * @param permissionGroupRoleIdPo 权限组集合和角色ID
     * @return R
     */
    R endowPermission(PermissionGroupRoleIdPo permissionGroupRoleIdPo);
}
